import request from '@/utils/request'

export function getGiftList(query) {
  return request({
    url: '/gift/list',
    method: 'get',
    params: query
  })
}

export function handleGift(data) {
  return request({
    url: '/gift/handle',
    method: 'post',
    data
  })
}

export function deleteGift(id) {
  return request({
    url: `/gift/${id}`,
    method: 'delete'
  })
}

export function getGiftCodeConfigList(query) {
  return request({
    url: '/gift/code/config/list',
    method: 'get',
    params: query
  })
}

export function handleGiftCodeConfig(data) {
  return request({
    url: '/gift/code/config/handle',
    method: 'post',
    data
  })
}

export function deleteGiftCodeConfig(id) {
  return request({
    url: `/gift/code/config/${id}`,
    method: 'delete'
  })
}

export function getGiftCodeList(query) {
  return request({
    url: '/gift/code/list',
    method: 'get',
    params: query
  })
}

export function getGiftCodeLogList(query) {
  return request({
    url: '/gift/code/log/list',
    method: 'get',
    params: query
  })
}

export function getQuestionnaireList(query) {
  return request({
    url: '/questionnaire/list',
    method: 'get',
    params: query
  })
}

export function handleQuestionnaire(data) {
  return request({
    url: '/questionnaire/handle',
    method: 'post',
    data
  })
}

export function deleteQuestionnaire(id) {
  return request({
    url: `/questionnaire/${id}`,
    method: 'delete'
  })
}

export function getQuestionnaireConfList(query) {
  return request({
    url: '/questionnaire/conf/list',
    method: 'get',
    params: query
  })
}

export function getQuestionnaireLog(query) {
  return request({
    url: '/questionnaire/log',
    method: 'get',
    params: query
  })
}

export function getQuestionnaireStatic(query) {
  return request({
    url: '/questionnaire/static',
    method: 'get',
    params: query
  })
}

export function getActorInfo(query) {
  return request({
    url: '/inner/grant/actor/info',
    method: 'get',
    params: query
  })
}

export function handleGrant(data) {
  return request({
    url: '/inner/grant/handle',
    method: 'post',
    data
  })
}

export function getGrantList(query) {
  return request({
    url: '/inner/grant/list',
    method: 'get',
    params: query
  })
}

export function deleteGrant(data) {
  return request({
    url: `/inner/grant/delete`,
    method: 'post',
    data
  })
}

export function approvedGrant(data) {
  return request({
    url: `/inner/grant/approved`,
    method: 'post',
    data
  })
}

export function checkActor(query) {
  return request({
    url: '/inner/grant/job/actor/check',
    method: 'get',
    params: query
  })
}

export function approvedJob(data) {
  return request({
    url: '/inner/job/approved',
    method: 'post',
    data
  })
}

export function handleGrantJob(data) {
  return request({
    url: '/inner/grant/job/handle',
    method: 'post',
    data
  })
}

export function getGrantJobList(query) {
  return request({
    url: '/inner/grant/job/list',
    method: 'get',
    params: query
  })
}

export function deleteGrantJob(id) {
  return request({
    url: `/inner/grant/job/${id}`,
    method: 'delete'
  })
}

export function handleGrantJobStatus(data, id) {
  return request({
    url: `/inner/grant/job/handle/${id}`,
    method: 'patch',
    data
  })
}

export function getInnerAccountList(query) {
  return request({
    url: '/inner/account/list',
    method: 'get',
    params: query
  })
}

// VIP客服
export function getVipServiceList(query) {
  return request({
    url: '/vip/service/list',
    method: 'get',
    params: query
  })
}

export function handleVipService(data) {
  return request({
    url: `/vip/service/handle`,
    method: 'post',
    data
  })
}

export function handleSwithServiceStatus(status) {
  return request({
    url: `/vip/service/handle/${status}`,
    method: 'patch'
  })
}

export function deleteVipService(id) {
  return request({
    url: `/vip/service/${id}`,
    method: 'delete'
  })
}

// VIP列表
export function getVipList(query) {
  return request({
    url: '/vip/list',
    method: 'get',
    params: query
  })
}

export function handleVip(data) {
  return request({
    url: `/vip/handle`,
    method: 'post',
    data
  })
}

export function deleteVip(id) {
  return request({
    url: `/vip/${id}`,
    method: 'delete'
  })
}
